package com.neu.his.disease.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neu.his.disease.entity.Disease;
import com.neu.his.disease.mapper.DiseaseMapper;
import com.neu.his.disease.service.DiseaseService;

@Service
public class DiseaseServiceImpl implements DiseaseService{
	@Autowired
	private DiseaseMapper diseaseMapper;

	@Override
	public List<Disease> getdiseaseInfo(int diseCategoryID, int page, int limit) {
		// TODO Auto-generated method stub
		return diseaseMapper.getdiseaseInfo(diseCategoryID, page, limit);
	}

	@Override
	public int getdiseaseInfoTotal(int diseCategoryID) {
		// TODO Auto-generated method stub
		return diseaseMapper.getdiseaseInfoTotal(diseCategoryID);
	}

	@Override
	public boolean addDisease(Disease disease) {
		// TODO Auto-generated method stub
		 
		int flag = diseaseMapper.addDisease(disease);
		if(flag>0) {
			return true;
		}
		else {
			return false;
		}
		
	}

	@Override
	public boolean delDiseaseByIds(Integer[] ids) {
		// TODO Auto-generated method stub
		int flag = diseaseMapper.delDiseaseByIds(ids);
		if(flag>0) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public boolean updateDisease(Disease disease) {
		// TODO Auto-generated method stub
		int flag = diseaseMapper.updateDisease(disease);
		if(flag>0) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public Integer[] getDiseaseIds(int diseCategoryID) {
		// TODO Auto-generated method stub
		return diseaseMapper.getDiseaseIds(diseCategoryID);
	}


}
